<UserControl x:Class="Microsoft.FamilyShow.FilterText"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

  <UserControl.Resources>
    
    <!-- border style -->
    <Style x:Key="BorderStyle" TargetType="{x:Type Border}">
      <Setter Property="BorderBrush" Value="{DynamicResource BackgroundBrush}" />
      <Setter Property="BorderThickness" Value="1" />
      <Setter Property="CornerRadius" Value="3" />
      <Setter Property="HorizontalAlignment" Value="Stretch" />
      <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}" />
    </Style>

    <!-- textbox style -->
    <Style x:Key="TextStyle" TargetType="{x:Type TextBox}">
      <Setter Property="Margin" Value="2,1,2,2" />
      <Setter Property="BorderThickness" Value="0" />
      <Setter Property="BorderBrush" Value="{x:Null}" />
      <Setter Property="BorderThickness" Value="0" />
      <Setter Property="HorizontalAlignment" Value="Stretch" />
      <Setter Property="VerticalAlignment" Value="Center" />
    </Style>

    <!-- reset button style -->
    <Style x:Key="ButtonStyle" TargetType="{x:Type Button}">
      <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}" />
      <Setter Property="Width" Value="20" />
      <Setter Property="FontWeight" Value="Bold" />
      <Setter Property="BorderBrush" Value="{x:Null}" />
      <Setter Property="BorderThickness" Value="0" />
    </Style>
  </UserControl.Resources>

  <!-- filter control -->
  <Border Style="{StaticResource BorderStyle}">
    <DockPanel>
      <Button x:Name="FilterButton" DockPanel.Dock="Right" Content="X" ToolTip="Clear Filter Text" 
        Style="{StaticResource ButtonStyle}" Click="FilterButton_Click" />
      <TextBox x:Name="FilterTextBox" DockPanel.Dock="Left" 
        Style="{StaticResource TextStyle}" TextChanged="FilterTextBox_TextChanged" />
    </DockPanel>
  </Border>
  
</UserControl>
